/*
 * @Author: hongbin
 * @Date: 2022-11-20 22:24:58
 * @LastEditors: hongbin
 * @LastEditTime: 2022-11-20 22:24:59
 * @Description:获取世界消息列表
 */
import { NextApiRequest, NextApiResponse } from "next";
import DB from "../mongodb";

export default async function handler(req: NextApiRequest, res: NextApiResponse<any>) {
    const db = await DB;

    const list = await db.collection("worldNews").find({}).toArray();
    res.json(list);
}
